$('#submit').click(function(){
    var id=$('#name').text();
    var user=$('#user').prop('checked');
    var password=$('#password').prop('checked');
    var operate=$('#operate').prop('checked');
    var admin=$('#admin').prop('checked');
    var oil=$('#oil').prop('checked');
    var list=$('#list').prop('checked');
    var power=$('#power').prop('checked');
    var announce=$('#announce').prop('checked');
    if(!user){
        user=0;
    }
    else{
        user=1;
    }
    if(!password){
        password=0;
    }
    else{
        password=1;
    }
    if(!operate){
        operate=0;
    }
    else{
        operate=1;
    }
    if(!admin){
        admin=0;
    }
    else{
        admin=1;
    }
    if(!oil){
        oil=0;
    }
    else{
        oil=1;
    }
    if(!list){
        list=0;
    }
    else{
        list=1;
    }
    if(!power){
        power=0;
    }
    else{
        power=1;
    }
    if(!announce){
        announce=0;
    }
    else{
        announce=1;
    }
    console.log(id,user,password,operate,admin,oil,list,power,announce);

    var url = "../power/updateAction";
    var data = {'id':id,'user':user,'password':password,'operate':operate,'admin':admin,'oil':oil,'list':list,'power':power,'announce':announce};
    // 执行异步请求  $.post
    $.post(url,data,function(result){
        if(result.status == 0) {
            return dialog.error(result.message);
        }
        if(result.status == 1) {
            return dialog.success(result.message, '../power/index');
        }
    },'JSON');
})

